<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page import ="com.aq.model.*,java.util.Map" %>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>
<s:include value="../include.jsp"></s:include>
<%
String content = (String)request.getAttribute("content");
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
if(null == content || "".equalsIgnoreCase(content)|| "null".equalsIgnoreCase(content)){
  content = " "; 
}

 %>
<html>
<head>
<title>编辑</title> 
<script src='<%=basePath%>dwr/interface/dwrSelect.js'></script>
<script src='<%=basePath%>dwr/engine.js'></script>
<script src='<%=basePath%>dwr/util.js'></script>
<script type="text/javascript">
function addProduct(){ 
   document.location.href="edit.jsp";
}
function submitForm(){
   document.editForm.submit(); 
}
function initSelect(id,type){
   dwrSelect.getSelectHTMLStr(id,type,callBackForSelect);
}
function callBackForSelect(data){ 
//其中date接收方法的返回值   
 //对于JavaBean返回值，有两种方式处理   
 //不知道属性名称时，使用如下方法   
 //for(var property in data){   
  //alert("property:"+property);   
  //alert(property+":"+data[property]);   
 //}  
 //if(data.length > 2)
 dwr.util.addOptions( "productType", eval(data),'id','name');   
  
} 
</script>



</head>
<body onload="initSelect(0,1);">
<center>
<table cellSpacing=0 align=right cellPadding=0 border=3 width="100%">
<tr>
<td>
<table   cellSpacing=0 align=right cellPadding=0 border=0 valign=top>
<tr>
<td><input name="button" type="button" class="buttom"  onclick="submitForm();" value="保存"></td>
<td><input name="button" type="button" class="buttom" onclick="initSelect(0,1);" value="列表"></td> 
<td></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<s:form name="editForm" action="saveProduct" validate="true">
<table align="center" width="100%"> 

       <tr>
       <td width="10%">
        所属类别
       </td>
       <td width="45%">
       <select name="productType"><option value="">------请选择------</option></select>
       </td>
       <td width="45%">
       <select ><option>222</option><option>222</option><option>222</option></select>
       </td>
       </tr> 
       <tr>
       <td>
        产品名称
       </td>
       <td colspan=2>
       <input type="input" name="product.productName" value="<%=((AqProduct)request.getAttribute("product"))==null?"":((AqProduct)request.getAttribute("product")).getProductName() %>" size="160">
       </td> 
       </tr> 
        <tr>
       <td>
        产品序列号
       </td>
       <td>
        <input type="input" name="product.productCode" value="" size="80">
       </td>
       <td>
        单独
       </td>
       </tr> 
       <tr>
       <td>
        产品图片
       </td>
       <td>
        <input type="input" name="" value="" size="80">
        <input type="hidden" value="<%=request.getAttribute("product")==null?"":request.getAttribute("productid")%>" name="productid"/>
       </td>
       <td>
        <input type="file" name="" value="" size="80">
       </td>
       </tr> 
	  <tr>
	  <td>
        产品描述
       </td>
		<td colspan=2> 
		<FCK:editor instanceName="product.memo" height="500pt">
         <jsp:attribute name="value"><%=content%></jsp:attribute>
         </FCK:editor>  
		</td>
	</tr>  
	</table>
	</s:form>
	</td>
	</tr>
	</table>
	</center>
</body>
</html>